package java5;

import java.util.ArrayList;
import java.util.Scanner;

class  Fruit{
	String name;
	public Fruit(String name){
		this.name=name;
	}
	public boolean equals(Object obj){  
		 if (this == obj) {
	            return true;
		 }
	        if (obj == null) {
	            return false;
	        }
            if (getClass() != obj.getClass()){ 
                return false;}
            Fruit fruit=(Fruit)obj;
            return (this.name.equalsIgnoreCase(fruit.name));
                }  
	public String toString(){
		return name;
		
		
	}
}
public class Main1 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner=new Scanner(System.in);
		ArrayList<Fruit>fruitlist= new ArrayList<Fruit>();
		Fruit na=new Fruit("hello");
		Fruit nc=new Fruit("HELLO");
		fruitlist.add(na);
		fruitlist.add(nc);
		Fruit f=new Fruit("hello");
		Fruit a=new Fruit("what");
		if(fruitlist.contains(a))	
	     System.out.println("contains");
		else 
          fruitlist.add(a);
		if(fruitlist.contains(f))
		System.out.println("contains");
		else fruitlist.add(f);
		for(int i=0;i<fruitlist.size();i++)
		  {
		   System.out.println(fruitlist.get(i));
		  }
}
}
